import axios from '@/utils/request';




/**
 * 获取管理员工作台数据
 */
 export async function getAdminSaleData() {
  const res = await axios.get('/system.user/getAdminSaleData');
  if (res.data.code === 0) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.message));
}


/**
 * 获取代理工作台数据
 */
 export async function getAdminChartData(params) {
  const res = await axios.get('/system.user/getAdminChartData',{params});
  if (res.data.code === 0) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.message));
}

/**
 * 获取账号工作台数据
 */
 export async function getAccountLinkData() {
  const res = await axios.get('/system.user/getAccountLinkData');
  if (res.data.code === 0) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.message));
}

/**
 * 获取账号工作台数据
 */
 export async function getAccountChartData(params) {
  const res = await axios.get('/system.user/getAccountChartData',{params});
  if (res.data.code === 0) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.message));
}

/**
 * 获取账号工作台数据
 */
 export async function getAccountStatisData(params) {
  const res = await axios.get('/system.user/getAccountStatisData',{params});
  if (res.data.code === 0) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.message));
}

/**
 * 获取账号工作台数据
 */
 export async function getAccountAvatarData(params) {
  const res = await axios.get('/system.user/getAccountAvatarData',{params});
  if (res.data.code === 0) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.message));
}

/**
 * 获取账号工作台数据
 */
 export async function getAccountVoiceData(params) {
  const res = await axios.get('/system.user/getAccountVoiceData',{params});
  if (res.data.code === 0) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.message));
}

/**
 * 获取账号工作台数据
 */
 export async function getAccountVideoData(params) {
  const res = await axios.get('/system.user/getAccountVideoData',{params});
  if (res.data.code === 0) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.message));
}
